]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
animationUtils: Skip no-op wiggle to avoid cancelling pending transitions
authorJoan Torres Lopez <joantolo@redhat.com>
Tue, 5 May 2026 15:26:27 +0000 (17:26 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 14 May 2026 18:26:03 +0000 (18:26 +0000)
When wiggle() is called with duration 0, the async easeAsync calls
yield between microtasks, leaving pending operations that remove
transitions on the same property. This becomes a problem when two
setMessage() calls happen in the same call stack (e.g. via
_queuePriorityMessage): the first fires a no-op wiggle(dur:0) and
the second starts the real wiggle(dur:65). When microtasks drain,
the first wiggle's pending easeAsync calls overwrite the second
wiggle's active transition, effectively cancelling the real animation.

Return early when duration is 0, since the animation is a no-op anyway.

Fixes: fdadbb7a5a2 ("animationUtils: Use easeAsync() for wiggle")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/9207
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4209>

js/misc/animationUtils.js

index 44d6e2fff4ac1d995785d2c883d8132e8c071c44..2112b59f38b0d5e0a5d60241d8d1ff3fa3fefb34 100644 (file)
@@ -85,7 +85,7 @@ export function ensureActorVisibleInScrollView(scrollView, actor) {
  * @param {number} params.wiggleCount - the number of times to wiggle the actor
  */
 export async function wiggle(actor, params) {
-    if (!St.Settings.get().enable_animations)
+    if (!St.Settings.get().enable_animations || params?.duration === 0)
         return;
 
     params = Params.parse(params, {